//
//  CommonCell2.m
//  didipai
//
//  Created by 陈一航 on 16/3/8.
//  Copyright (c) 2016年 wangjia_01. All rights reserved.
//

#import "CommonCell2.h"
#import "NSString+MLExpression.h"
@implementation CommonCell2


- (void)awakeFromNib {    
    // Initialization code
    [isLogin FilletImg:_userPhoto :44];
    
    self.userRepay .allowLineBreakInsideLinks = NO;
    self.userRepay .linkTextAttributes = nil;
    self.userRepay .activeLinkTextAttributes = nil;
    //注意，[心碎了]这个其实是匹配了正则，但是没有对应图像的，这里是故意加个这样的来测试。
    [self.userRepay  setDidClickLinkBlock:^(MLLink *link, NSString *linkText, MLLinkLabel *label) {
        NSString *tips = [NSString stringWithFormat:@"Click\nlinkType:%ld\nlinkText:%@\nlinkValue:%@",(unsigned long)link.linkType,linkText,link.linkValue];
        DLog(@"%@",tips);
        if (link.linkType==1) {
            //网址类型
            
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:link.linkValue]];
            
        }
        
    }];

    
}


- (void)setQzContentLable:(NSString *)str
{
    MLExpression *exp = [MLExpression expressionWithRegex:@"\\[[//a-zA-Z0-9\\u4e00-\\u9fa5]+\\]" plistName:@"Expression" bundleName:@"emojiImgs"];
    
    self.userRepay.attributedText = [str expressionAttributedStringWithExpression:exp];
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
   
    
    // Configure the view for the selected state
}

@end
